<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	  <style>
        input {
            display: block;
            width: 400px;
            height: 30px;
            margin: 10px;
            font-size: 18px;
            padding-left: 10px;
            border: 1px solid #ccc;
            outline-style: none;
        }
        .bgc{
        	background-color: red;
        	border: 1px solid #000;
        }
    </style>

</head>
<body>
	 <input type="text"/>
    <input type="text"/>
    <input type="text"/>
    <input type="text"/>
    <input type="text"/>
    <input type="text"/>
    <input type="text"/>

</body>
<script src="../jquery-1.12.4.js"></script>
<script>

$("input").on("focus",function(){
	$("input").removeClass("bgc");
	$(this).addClass("bgc");
})

$("input").on("blur",function(){
	$("input").removeClass("bgc");
	$(this).css("background-color","#fff");
})

</script>
</html>